package com.example.testcalendar;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.widget.Toast;

public class GmailSelectionDialog extends DialogFragment {

	private String[] items = { "a", "b", "c" };

	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) {

		String title = "Select your Gmail account: ";

		AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(
				getActivity());
		dialogBuilder.setTitle(title).setItems(items,
				new DialogInterface.OnClickListener() {

					@Override
					public void onClick(DialogInterface dialog, int which) {
						Toast.makeText(getActivity(), items[which],
								Toast.LENGTH_LONG).show();
					}
				});

		return dialogBuilder.create();
	}

}
